package com.xjgc.controller;

import com.xjgc.rest.ao.MsiRealAO;
import com.xjgc.server.MsiRealHandle;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

/**
 * 财务-即时异步请求SAP
 *
 * @author： lyf
 * @date： 2023/8/19 15:50
 * @version： 1.0
 * @description:
 */
@Validated
@Api(tags = "财务-即时请求SAP异步处理")
@RestController
@RequestMapping("/realasy/sap/finance")
@Slf4j
public class RealSapFinanceAsyController {

    private static final String SERVER_CODE = "MsiRestReal";

    @Resource
    private MsiRealHandle msiRealHandle;

    @ApiOperation("开票申请结果回传SAP")
    @PostMapping("/applyResultBack")
    public Result<?> applyResultBack(@RequestBody Map<String, Object> param) {
        MsiRealAO msiRealAO = new MsiRealAO(SERVER_CODE, "applyResultBack", param);
        Result<?> result = msiRealHandle.handle(msiRealAO);
        return result;
    }


    @ApiOperation("全电发票-开票申请")
    @PostMapping("/qdfpKpsq")
    public Result<?> qdfpKpsq(@RequestBody Map<String, Object> param) {
        MsiRealAO msiRealAO = new MsiRealAO(SERVER_CODE, "qdfpKpsq", param);
        Result<?> result = msiRealHandle.handle(msiRealAO);
        return result;
    }


}
